﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using COM.Service;
using COM.Web;


namespace WebApp.Web.Service
{
    static public class UnityExtension
    {
        static public COM.Data.IUnity RegisterAppService(this Unity unity)
        {
            unity
                    .RegisterSingleton<IAppPermissionRegister, AppPermissionRegister>()
                    .RegisterSingleton<ILogErrorService, LogErrorService>()
                    .RegisterSingleton<ISingletonService, SingletonService>()
                    //.Register<COM.Web.ILoginService, AppLoginService>()
                    //.Register<IAppLoginService, AppLoginService>()
                    .Register<COM.Web.IUserPrincipalFactory, AppUserPrincipalFactory>()
                    .Register<IAppUserPrincipalFactory, AppUserPrincipalFactory>()

                    .Register<IRuntime, AppRuntimeService>()
                    .Register<IUploadFileService, UploadFileService>()
                    .Register<IImageService, ImageService>()
                    ;
            //WebSocket服务
            //unity.RegisterSingleton<IWebSocketService, WebSocketService>()
                 
            return unity;

        }
    }
}